package bb.lanxing.utils;

public class TimeUtil {
	// 定义常量
	private static final long SECONDS_IN_A_DAY = 86400;
	private static final long SECONDS_IN_AN_HOUR = 3600;
	private static final long SECONDS_IN_A_MINUTE = 60;

	public static String convertSeconds(long totalSeconds) {
		if (totalSeconds <= 0) {
			return 0 + "," + 0;
		}
		// 计算天数
		long days = totalSeconds / SECONDS_IN_A_DAY;
		long remainingSeconds = totalSeconds % SECONDS_IN_A_DAY;

		// 计算小时数
		long hours = remainingSeconds / SECONDS_IN_AN_HOUR;
		remainingSeconds %= SECONDS_IN_AN_HOUR;

		// 计算分钟数
		long minutes = remainingSeconds / SECONDS_IN_A_MINUTE;
		remainingSeconds %= SECONDS_IN_A_MINUTE;

		return days + "," + hours;
	}
}
